package com.example.test;

import com.example.test.bean.OrderService;
import org.junit.Test;
import org.myspringframework.core.ApplicationContext;
import org.myspringframework.core.ClassPathXmlApplicationContext;

/**
 * ClassName:testBean
 * Package:com.example.test
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/9-20:10
 * @Version:v1.0
 */
public class testBean {
    @Test
    public void testBean() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-myspring.xml");
        Object vip = applicationContext.getBean("vip");
        System.out.println(vip);

        OrderService orderService = (OrderService) applicationContext.getBean("orderService");
        orderService.generate();
    }
}
